import java.sql.*;
import java.util.*;
class JdbcDemo17{
	public static void main(String args[]) throws Exception
	{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
	Scanner scan = new Scanner(System.in);
	
	PreparedStatement ps = cn.prepareStatement("select * from employee where eno =?");
	System.out.println("input empno");
	int eno = scan.nextInt(); 
	ps.setInt(1, eno);
	ResultSet rs = ps.executeQuery();
	if(rs.next())
		System.out.println(rs.getInt(1)+"  "+rs.getString(2)+"  "+rs.getFloat(3));
	else
		System.out.println("invalid empno");
	rs.close();
	ps.close();
	cn.close();
		// TODO Auto-generated method stub
	
	}
	
	
	
}
